<template>
  <div class="info">
    <div class="tab">
      <el-form ref="form" :model="form" label-width="100px">
        <el-row>
          <el-col :span="16">
            <el-form-item label="店铺名">
              <el-input
                :readonly="true"
                v-model="form.name"
                placeholder="请输入店铺名"
              ></el-input>
            </el-form-item>
            <el-form-item label="店铺地址">
              <el-input
                :readonly="true"
                v-model="form.address"
                placeholder="请输入店铺地址"
              ></el-input>
            </el-form-item>
            <el-form-item label="店铺分类">
              <el-input
                :readonly="true"
                v-model="form.type"
                placeholder="请输入分类"
              ></el-input>
            </el-form-item>
            <el-form-item label="汇付id">
              <el-input
                v-model="form.huifuId"
                placeholder="请输入汇付idid"
              ></el-input>
            </el-form-item>
            <el-form-item label="审核">
              <el-radio-group v-model="examine">
                <el-radio label="P">通过</el-radio>
                <el-radio label="F">驳回</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="通知">
              <el-radio-group v-model="info">
                <el-radio label="0">全部</el-radio>
                <el-radio label="SMS">短信</el-radio>
                <el-radio label="EMAIL">邮件</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="理由">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入操作理由"
                v-model="form.textarea"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item>
          <el-button type="primary" @click="handleSubmit">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { doSettleIn } from "@/api/merchant";
export default {
  props: ["rowData"],
  data() {
    return {
      form: {
        name: "",
        address: "",
        type: "",
        huifuId: "",
      },
      examine: "P", //审核
      info: "0", //通知
      textarea: "", //理由
    };
  },
  methods: {
    async doSettleIn() {
      const { err, msg } = await doSettleIn({
        id: this.form.id,
        type: this.examine,
        hf_id: "",
        notify_tag: this.info,
        remark: this.textarea,
      });
      if (err === 0) {
        this.$message({
          showClose: true,
          message: "操作成功",
          type: "success",
        });
        this.$emit("handleClose");
      } else {
        this.$message({
          showClose: true,
          message: msg,
          type: "error",
        });
      }
    },
    handleSubmit() {
      this.doSettleIn();
    },
  },
  created() {
    console.log(this.rowData);
    this.form = this.rowData;
  },
};
</script>

<style lang="scss" scoped>
.tbImg1 {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.slt {
  width: 50px;
  height: 36px;
  margin: 0 auto;
  .tbImg {
    width: 50px;
    height: 36px;
    border-radius: 8px;
  }
}
.info {
  .title {
    font-size: 16px;
    margin-bottom: 13px;
  }
  .tab {
    background-color: #fff;
  }
}
.pagination {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}
/deep/.el-breadcrumb__inner {
  cursor: pointer !important;
}
/deep/.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
}
.avatar {
  width: 80px;
  height: 80px;
  display: block;
}
/deep/.el-upload--picture-card {
  width: 90px;
  height: 90px;
  line-height: 90px;
}
/deep/.el-upload-list__item {
  width: 90px !important;
  height: 90px !important;
  border: 0 !important;
}
</style>
